//
//  MYGConst.swift
//  MYGrow
//
//  Created by 小火科技 on 2024/2/23.
//

import Foundation
import UIKit
public typealias voidBlock = () -> Void
public typealias intBlock = (Int) -> Void
let navHeight: CGFloat = 44
var statusBarHeight: CGFloat {
    let scene = UIApplication.shared.connectedScenes.first as? UIWindowScene
    return scene?.windows.first?.windowScene?.statusBarManager?.statusBarFrame.height ?? 0
}

var bottomSafeheight: CGFloat {
    let scene = UIApplication.shared.connectedScenes.first as? UIWindowScene
    return scene?.windows.first?.safeAreaInsets.bottom ?? 0
}

let screenHeight = UIScreen.main.bounds.height
let screenWidth = UIScreen.main.bounds.width

let tabbarHeight: CGFloat = 44
//rgb颜色设置
func RGBA(r:CGFloat,g:CGFloat,b:CGFloat,a:CGFloat) -> UIColor {
    return UIColor.init(red: r/255.0, green: g/255.0, blue: b/255.0, alpha: a)
}
//标注适配
public func SCALEWIDTH(_ x:CGFloat)->CGFloat{
    return x*screenWidth/375.0
}
//文字宽高
public func getStringSize(font:UIFont,viewSize:CGSize,str:String) -> CGSize{
    let rect = str.boundingRect(with: viewSize, options: [.usesLineFragmentOrigin,.truncatesLastVisibleLine,.usesFontLeading], attributes: [NSAttributedString.Key.font:font], context: nil)
    return rect.size
}


let protoclUrl = "http://h5-dev.medataplus.com/#/pages/userAgreement/userAgreement?type=fwxy"
let privacyUrl = "http://h5-dev.medataplus.com/#/pages/userAgreement/userAgreement?type=ysxy"

// 百度地图
let mapAK = "RhStbcmSBZonMGizMWIvYW6vMbLHOAdg"
let mapJSAK = "fB79OpnCvI2f1srUvu3zEArJC6ihDc40"

let placeholderImage = UIImage(named: "head_demo")
let headPlaceholderImage = UIImage(named: "head")

//分享域名
//测试
//let shareUrl = "http://h5-dev.medataplus.com"
//let BaseUrl = "http://yz-server-dev.medataplus.com"
//let Url = "http://my-server-dev.medataplus.com"

//线上
let shareUrl = "http://h5.medataplus.com"
let BaseUrl = "http://yz-server.medataplus.com"
let Url = "http://my-server.medataplus.com"




//
//测试
//http://47.93.150.30:8081 换 yz-server-dev.medataplus.com
//http://47.93.150.30:8083 换：my-server-dev.medataplus.com
//线上
//http://101.201.28.48:8081 换 yz-server.medataplus.com
//http://101.201.28.48:8083 换：my-server.medataplus.com
